#include<bits/stdc++.h>
#define ONLINE_JUDGE
#define ll long long
#define ull unsigned long long
using namespace std;

ll n, flag = 0;
set<ll> a;

void solve()
{
    cin >> n;
    for (ll i = 1;i <= n;i++) {
        ll x; cin >> x;
        if (x == 0) { flag = 1;continue; }
        a.insert(x);
    }
    if (a.size() == 1) { cout << 0; return; }
    priority_queue<ll, vector<ll>, greater<ll> > q(a.begin(), a.end());

    ll ans = 0, sum = 0;
    while (!q.empty()) {
        ll x = q.size() + flag;
        ll num = q.top() - sum;q.pop();
        if (num <= 0)  continue;
        ll cnt = (num + x - 1) / x;
        sum += cnt * x;flag = 1;
        ans += cnt;
    }
    cout << ans;
}

signed main()
{
    // ios::sync_with_stdio(0);
    // cin.tie(0);cout.tie(0);
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll T = 1;
    //cin>>T;
    for (ll i = 1;i <= T;i++) {
        solve();
    }
}